using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq.Expressions;
using Icms.Core.Model;
using File = Icms.Core.Model.File;

namespace Icms.Core.Service
{
    public interface IRoomService : ICrudService<Room>
    {
        Guid Create(Room o, Court c);
    }

    public interface IFileService : ICrudService<File>
    {
    }

    public interface IUserService : ICrudService<User>
    {
        void ChangePassword(Guid userId, string password);
        Guid Create(User o, Court court);
        Court GetCourt(string  login);
        User GetByLogin(string login);
    }

    public interface ICourtsService<T> : ICrudService<T> where T : DelEntity, IHasCourt, new()
    {
        Guid Create(T o, Court court);
    }

    public interface IHearingService : ICrudService<Hearing>
    {
    }

    public interface ICrudService<T> where T : Entity, new()
    {
        Guid Create(T e);
        void Save(T o);
        void Delete(Guid id);
        T Get(Guid id);
        IEnumerable<T> GetAll();
        IEnumerable<T> Where(Expression<Func<T, bool>> predicate);

        
    }

    public interface IFileManagerService
    {
        string Save(Stream inputStream, string name);
        byte[] GetBytes(string fileName);
        Stream GetStream(byte[] bytes);
    }

    public interface IReportBuilder
    {
        string BuildReport(DataSet data, string templateName, DateTime dateFrom, DateTime dateTo, string title);
    }

    public interface IReportService
    {
        Guid Create(ReportRequest e, Guid userId);
        string GetFilePath(Guid id);
    }

    public interface IAssignmentHistoryService
    {
        IPageAbleResult<AssignmentHistory> GetPage(int page, int pageSize, CaseSearchCriteria criteria);
        IEnumerable<CaseAssignmentHistory> GetByCase(Guid caseId);
    }

    public interface ICaseService: ICrudService<Case>
    {
        string GetTitle(Guid id);
        string GetNewNumber(Case c);
    }

    public interface IBackupLogService
    {
        IEnumerable<BackupLog> GetPage(int page, int pageSize, Guid? courtId, out int count);
    }

}